﻿using System;
using umbraco.cms.businesslogic.datatype;
using umbraco.interfaces;

namespace netaddICTs.Umb.ProtectedMedia.Datatypes.MultipleMemberGroupPicker {
    
    public class DataType : BaseDataType, IDataType {
    
        private IData _data;
        private IDataEditor _dataEditor;
        private PrevalueEditor _prevalueEditor;

        #region IDataType Members

        public override IDataEditor DataEditor {
            get {
                if (_dataEditor == null)
                    _dataEditor = new DataEditor(Data);
                return _dataEditor;
            }
        }

        public override IData Data {
            get {
                if (_data == null)
                    _data = new DefaultData(this);
                return _data;
            }
        }

        public override Guid Id {
            get { return new Guid("CB5965C2-AF26-4583-9B05-BB6D7156D35B"); }
        }

        public override string DataTypeName {
            get { return "Multiple Member Group Picker"; }
        }

        public override IDataPrevalue PrevalueEditor {
            get {
                if (_prevalueEditor == null)
                    _prevalueEditor = new PrevalueEditor(this);
                return _prevalueEditor;
            }
        }

        #endregion
    }
}